package com.dayaokeji.rhythmschoolstudent.client.common.exam.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayaokeji.rhythmschoolstudent.R;
import com.dayaokeji.rhythmschoolstudent.client.common.exam.subject_type.utils.ScoreUtil;
import com.dayaokeji.rhythmschoolstudent.utils.DateUtils;
import com.dayaokeji.rhythmschoolstudent.utils.ExamUtils;
import com.dayaokeji.server_api.domain.Exam;

/**
 * Created by Gorden on 2017/10/18.
 * 考试题库列表
 */

public class TestedExamListAdapter extends BaseQuickAdapter<Exam,BaseViewHolder> {

    public TestedExamListAdapter() {
        super(R.layout.item_tested_exam_list, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, Exam item) {

        helper.setText(R.id.tv_exam_title,item.getName());
        TextView textView = (TextView) helper.getView(R.id.tv_exam_status);
        if (item.getResultStatus() == 2 && item.getStatus() == 4) {
            textView.setText(ScoreUtil.doubleTrans(Double.parseDouble(item.getScore()))+"分");
        }else{
            helper.setText(R.id.tv_exam_status, item.getScore());
        }
    }
}
